{% set menus = request.state.template_data.menus %}
{% if menus %}
    <ul id="gnb_1dul" class="d-md-flex fs-4">
        <li class="position-relative p-0">
            <button type="button" class="d-none" title="完整菜单">
                <i class="fa fa-bars" aria-hidden="true"></i>
                <span class="blind">打开完整菜单</span>
            </button>
        </li>
        {% for menu in menus %}
            {% set is_submenu = True if menu.sub|count > 0 else False %}
            <li class="gnb_1dli {% if is_submenu %}dropdown{% endif %}" style="z-index:{{ 999 - loop.index }}">
                <a href="{{ menu.me_link }}" target="_{{ menu.me_target }}" class="d-block fw-bold p-4 sub-font text-decoration-none fs-4 {% if is_submenu %}dropdown-toggle{% endif %}" data-mdb-toggle="dropdown" aria-expanded="false" >{{ menu.me_name }}</a>
                {% if is_submenu %}
                    <span class="blind">子分类</span>
                        <ul class="dropdown-menu start-50 translate-middle-x flex-column main-bg rounded-3 overflow-hidden" aria-labelledby="dropdownMenuButton">
                            {% for sub in menu.sub %}
                                <li>
                                    <a href="{{ sub.me_link }}" target="_{{ sub.me_target }}" class="dropdown-item main-bg text-white p-4 fs-4">{{ sub.me_name }}</a>
                                </li>
                            {% endfor %}
                        </ul>
                {% endif %}
            </li>
        {% else %}
            <li class="gnb_empty main-font py-3 2-100 text-center" style="color: #080808;line-height: 3.2rem;">
                正在准备菜单.
                <a href="{{ url_for('menu_list') }}" class="em-font" style="text-decoration: underline;">管理器模式 &gt; 环境设置 &gt; 菜单设置</a>可以设置在.
            </li>
        {% endfor %}
    </ul>
    <div id="gnb_all" class="position-absolute d-none">
        <h2 class="blind">完整菜单</h2>
        <ul class="gnb_al_ul">
            {% for menu in menus %}
                {% set is_submenu = True if menu.sub|count > 0 else False %}
                <li class="gnb_al_li">
                    <a href="{{ menu.me_link }}" target="_{{ menu.me_target }}" class="gnb_al_a">{{ menu.me_name }}</a>
                    {% if is_submenu %}
                        <ul>
                            {% for sub in menu.sub %}
                                <li><a href="{{ sub.me_link }}" target="_{{ sub.me_target }}">{{ sub.me_name }}ss</a></li>
                            {% endfor %}
                        </ul>
                    {% endif %}
                </li>
            {% else %}
                <li class="gnb_empty main-font py-3 2-100 text-center" style="color: #080808;line-height: 3.2rem;">
                    正在准备菜单.
                    <br><a href="{{ url_for('menu_list') }}" class="em-font" style="text-decoration: underline;">管理器模式 &gt; 环境设置 &gt; 菜单设置</a>可以设置在.
                </li>
            {% endfor %}
        </ul>
        <button type="button" class="gnb_close_btn">
            <i class="fa fa-xmark" aria-hidden="true"></i>
        </button>
    </div>
    <div id="gnb_all_bg"></div>
{% endif %}